<template>
  <Tabs type="card" @on-click="changeTab">
    <TabPane label="内容分类">
      <content ref="content" type="content" :currentTab="currentTab" />
    </TabPane>
    <TabPane label="素材分类">
      <content ref="sucai" type="sucai" :currentTab="currentTab" />
    </TabPane>
    <TabPane label="账号类型">
      <content ref="accounts" type="accounts" :currentTab="currentTab" />
    </TabPane>
  </Tabs>
</template>

<script>
import content from "./content.vue";
export default {
  name: "basicsetup",
  components: { content },
  data() {
    return {
      currentTab: "content",
    };
  },
  mounted() {
    this.$refs[this.currentTab].getData(this.currentTab);
  },
  methods: {
    changeTab(e) {
      switch (e) {
        case 0:
          this.currentTab = "content";
          break;
        case 2:
          this.currentTab = "accounts";
          break;
        case 1:
          this.currentTab = "sucai";
          break;
      }
      this.$refs[this.currentTab].getData(this.currentTab);
    },
  },
};
</script>
